$(document).ready(function() {
    var $musicplayer = $('#jp_container_1'),
        $player = $("#jquery_jplayer_1"),
        $birdmotion = $('#birdmotion'),
        $controled = $('.controled'),
        $inforbtn = $('.inforbtn'),
        $recordTrack = $('.recordTrack'),
        $recordImage = $('.recordImage'),
        $jp_play = $('.jp-play'),
        $jp_pause = $('.jp-pause'),
        audioFiles = ['/resources/music/Royals'],
        audioCurrentNo = 0;
    // audioElement = document.createElement('audio');
    // audioElement.id = "audioDiv";

    var $gnb_1_li = $('.gnb_1 > li'),
        $gnb_2 = $('.gnb_2'),
        $gnb_3 = $('.gnb_3'),
        $gnb = $('#gnb'),
        $nav_gnb_inner = $('.nav_gnb_inner'),
        $close_gnb = $('.close_gnb'),
        $open_gnb = $('.open_gnb'),
        body = $("html, body"),
        $gotoTop = $('.gotoTop');

    var popupOpen = false;


    $player.jPlayer({
        ready: function(event) {

            if (window.this_file == 'index' && $(window).innerWidth() > 768) {
                $(this).jPlayer("setMedia", {
                    m4a: audioFiles[audioCurrentNo] + ".m4a",
                    oga: audioFiles[audioCurrentNo] + ".ogg",
                    mp3: audioFiles[audioCurrentNo] + ".mp3"
                }).jPlayer("play");
            } else {
                $(this).jPlayer("setMedia", {
                    m4a: audioFiles[audioCurrentNo] + ".m4a",
                    oga: audioFiles[audioCurrentNo] + ".ogg",
                    mp3: audioFiles[audioCurrentNo] + ".mp3"
                });
            }
            //if
        },
        ended: function() {
            audio_ended();
            $(this).jPlayer("setMedia", {
                m4a: audioFiles[audioCurrentNo] + ".m4a",
                oga: audioFiles[audioCurrentNo] + ".ogg",
                mp3: audioFiles[audioCurrentNo] + ".mp3"
            }).jPlayer("play");
            // $(this).jPlayer("play");
        },
        swfPath: "/resources/js",
        solution: 'flash, html',
        wmode: "window",
        supplied: " m4a, oga, mp3"
            // errorAlerts: 'true'
    });


    if (window.this_file == 'index') {
        PlayPageFile = 1;
        // keyToggle('play');
    } else {
        PlayPageFile = -1;
        // keyToggle('pause');
        // $player.jPlayer("stop");
    }
    //if

    function audio_ended() {
            if (audioCurrentNo < audioFiles.length - 1) {
                audioCurrentNo++;
            } else {
                audioCurrentNo = 0;
            }
            //if     
        }
        //fn LoadAction


    //오디오 파일 재생 관련
    $jp_play.click(function() {
        keyToggle('play');
    });
    $jp_pause.click(function() {
        keyToggle('pause');
    });


    function keyToggle(event) {
        var _event = event;
        if (_event == "play") {
            /*$controled.find('.jp-pause').hide();
            $controled.find('.jp-play').show();*/
            $recordImage.removeClass('stoped').addClass('turned');
        } else {
            /*$controled.find('.jp-pause').show();
            $controled.find('.jp-play').hide();*/
            $recordImage.removeClass('turned').addClass('stoped');
        }
        eventClick(event);
    }
    var artistpop = "",
        $artistPopup = $('.artistPopup');

    $inforbtn.click(function(event) {
        var _this = $(this),
            orgImg = _this.find('img').attr('src');

        if (artistpop == "") {
            newImg = orgImg.replace(".png", "_click.png");
            _this.find('img').attr('src', newImg);
            artistpop = "open";
            $artistPopup.show().css({
                'height': 0
            }).stop().animate({
                    'height': '316px'
                }, 800, 'easeInOutCubic',
                function() {});
        } else if (artistpop == "open") {
            newImg = orgImg.replace("_click.png", ".png");
            _this.find('img').attr('src', newImg);
            artistpop = "close";
            $artistPopup.stop().animate({
                    'height': 0
                }, 800, 'easeInOutCubic',
                function() {
                    artistpop = "";
                    $artistPopup.hide();
                });
        }
        eventClick(event);
    });
    //재생 버튼 기능 정의




    function musicActiveCase() {
        var $windowWidth = $(window).innerWidth();
        if (PlayPageFile >= 0 && $windowWidth < 768) {
            keyToggle('pause');
            $player.jPlayer("stop");
            $('footer').hide();
        } else if (PlayPageFile >= 0 && $windowWidth > 768) {
            $('footer').hide();
        } else if (PlayPageFile < 0) {
            keyToggle('pause');
            $player.jPlayer("stop");
        }
        //if

        if ($windowWidth < 768) {
            $birdmotion.stop().animate({
                'left': '10px',
                'opacity': '0'
            }, 200, 'easeInCubic');
            $musicplayer.find('#record_bar').stop().animate({
                'top': '70px'
            }, 350, 'easeInCubic');
            $musicplayer.find('#controlbtn').stop().animate({
                'top': '70px'
            }, 200, 'easeInCubic');
            $musicplayer.find('.recordTrack').stop().animate({
                'top': '100px'
            }, 300, 'easeInCubic');
            // $gnb.height()            
        } else {
            $birdmotion.stop().animate({
                'left': '-10px',
                'opacity': '1'
            }, 200, 'easeOutQuint');
            $musicplayer.find('#record_bar').stop().animate({
                'top': '3px'
            }, 600, 'easeOutQuint');
            $musicplayer.find('#controlbtn').stop().animate({
                'top': '3px'
            }, 1000, 'easeOutQuint');
            $musicplayer.find('.recordTrack').stop().animate({
                'top': '0px'
            }, 800, 'easeOutQuint');

        }
    };
    musicActiveCase();


    /*-------------------상단 GNB-------------------*/
    // 웹사이트 버튼 정의 추가    
    $gotoTop.find('img').on('mouseenter', function() {
        var _this = $(this);
        _this.attr('src', '/resources/image/icon/gotoTop.gif');
        // console.log('오버')
    }).on("mouseleave", function() {
        var _this = $(this);
        _this.attr('src', '/resources/image/icon/gotoTop.png');
    }).on("click", function(event) {
        eventClick(event);
        body.stop().animate({
            scrollTop: 0
        }, 400, 'easeInOutQuint');
    })

    $gnb_1_li.on("mouseenter", function() {
            //over
            var _this = $(this);
            _this.css({
                'background-color': '#fff'
            }).find('li').css({
                'color': '#5c42c9'
            }).find('a').css({
                'color': '#5c42c9'
            });
        })
        .on("mouseleave", function() {
            //out
            var _this = $(this);
            _this.css({
                'background-color': 'inherit',
                'color': '#fff'
            }).find('li').css({
                'color': '#fff'
            }).find('a').css({
                'color': '#fff'
            });
        });
    //메뉴 오버시 li 배경 나오게 하기
    $gnb_3.find("a").parent().parent().on('mouseenter', function() {
        var _this = $(this);
        _this.find('.gnb_3 img').each(function() {
            var _this = $(this);
            getImg = _this.attr('src');
            newImg = getImg.replace(".png", "_hover.png");
            _this.attr('src', newImg);
        });
        //each
        // $gnb_3a.css({ 'border-top': '1px solid #fff' });    
    }).on('mouseleave', function() {
        var _this = $(this);
        _this.find('img').each(function() {
            var _this = $(this);
            getImg = _this.attr('src');
            newImg = getImg.replace("_hover.png", ".png");
            _this.attr('src', newImg);
        });
        //each
        // $gnb_3a.css({ 'border-top': '1px solid #b4a7eb' });
    });

    $open_gnb.click(function(event) {
        $gnb.css({
            "display": "block",
            "left": -$(window).innerWidth(),
            'opacity': '1'
        });
        $gnb.stop().animate({
            "left": "0"
        }, 400, 'easeOutQuint');
        ResizeGnb();
        GnbsnsButton();
        /* if(getCrntMediaQueryWidth() <= 2){            
             body.stop().animate({scrollTop:0},500,'easeOutQuint');
         }else{
             $gnb.css({"display": "table"});
         }*/
        $nav_gnb_inner.css("display", "none");
        eventClick(event);
        // console.log($('#wrap_about').height());
    });
    $close_gnb.click(function(event) {
        $gnb.stop().animate({
            "opacity": '0'
        }, 400, 'easeInQuint', function() {
            $gnb.css("display", "none");
        });
        $nav_gnb_inner.css("display", "block");
        eventClick(event);
    });
    //gnb 나오게 하는 버튼에 대한 액션
    var $gnb_1_li_a = $gnb_1_li.find("> a"),
        $gnb_2_li_a = $gnb_2.find(" a"),
        $like_gnb2 = $('.likegnb_2 > a'),
        // $gnb_3_li = $gnb_3a.find("li"),
        baseFontSize = 768;

    function ResizeGnb() {
            var wh = $(window).height(),
                newFontSize = Math.round(wh * 0.055),
                $gnb_1 = $('.gnb_1');
            $gnb_1_li_a.css({
                "font-size": Math.round(newFontSize) + "px",
                "line-height": Math.round(newFontSize * 1.3) + "px",
                "height": Math.round(newFontSize * 1.5) + "px"
            });
            $like_gnb2.css({
                "font-size": Math.round(newFontSize * 0.8) + "px",
                "line-height": Math.round(newFontSize * 1.3) + "px",
                "height": Math.round(newFontSize * 1.5) + "px"
            });
            $gnb_2_li_a.css("font-size", Math.round(newFontSize * 0.8) + "px");
            $gnb_3.find("a").css({
                "height": Math.round(newFontSize * 1.4) + "px",
                "line-height": Math.round(newFontSize * 1.4) + "px",
                "padding-left": Math.round(newFontSize * 0.3) + "px",
                "padding-right": Math.round(newFontSize * 0.3) + "px"
            });
            $gnb_3.find('img').css('width', Math.round(newFontSize * 1.2) + "px")


            $gnb_1.css({
                'margin-top': -($gnb_1.height() * 0.5) + 20
            });

        }
        //End fn.ResizeGnb
    function GnbsnsButton() {
        var snsBtn = $gnb_3.find("a");
        snsBtn.on('mouseenter', function() {
            var _this = $(this);
            _this.siblings().stop().animate({
                opacity: 0.4
            }, 300)
        }).on('mouseleave', function() {
            var _this = $(this);
            _this.siblings().stop().animate({
                opacity: 1
            }, 300)

        })
    }


    /*-------------------메인 슬라이드-------------------*/
    var $bgSlideLayer = $('#bgSlideLayer'),
        $bgSlideLayerImg = $('#bgSlideLayer > ul > li  img'),
        $slideLink = $('.slideLink'),
        $slideClickArea = $('.slideClickArea'),
        $index_articleWrap = $('.index_articleWrap'),
        $wrap_inner = $('.wrap_inner'),
        $bgSlideLayerWrap = $('#bgSlideLayerWrap'),
        $slideElement = $bgSlideLayer.find('li'),
        totalSlides = $bgSlideLayer.find('li').length,
        $slideNavul = $('#slideNavul'),
        $slideNavElement = $('#slideNavul').find('li'),
        $slideElementLast = $slideElement.eq(totalSlides - 1),
        $VcommArea = $('.VcommArea'),
        $VlabArea = $('.VlabArea'),
        getCrntMediaQueryWidth,
        speed = 1000,
        intervalTime = 3000,
        SlideInterval,
        crnt,
        datapart,
        navTop = new Number(),
        slideNavTop = new Number(),
        goto_part_lineheight = new Number(),
        goto_part_top = new Number();


    function FngetCrntMediaQueryWidth() {
            var CurrentWidth = bgsizeW;
            // console.log('크기 : '+CurrentWidth);
            if (CurrentWidth < 464) {
                // console.log("window size(463이하) : " + CurrentWidth);
                RtnValue = 0;
            } else if (CurrentWidth >= 464 && CurrentWidth < 767) {
                // console.log("window size(463~767) : " + CurrentWidth);
                RtnValue = 1;
            } else if (CurrentWidth >= 768 && CurrentWidth < 1023) {
                // console.log("window size(768~1023) : " + CurrentWidth);
                RtnValue = 2;
            } else if (CurrentWidth >= 1024 && CurrentWidth < 1279) {
                // console.log("window size(1024~1279) : " + CurrentWidth);
                RtnValue = 3;
            } else if (CurrentWidth >= 1280 && CurrentWidth < 1419) {
                // console.log("window size(1280~1419) : " + CurrentWidth);
                RtnValue = 4;
            } else if (CurrentWidth >= 1420) {
                RtnValue = 5;
                // console.log("window size(1420) : " + CurrentWidth);
            } else {
                RtnValue = undefined;
            }
            // return RtnValue;
            getCrntMediaQueryWidth = RtnValue;
            // console.log('CurrentWidth : ' + CurrentWidth)
        }
        /* 브라우져 사이즈 */
    var $windowWidth = $('.windowWidth'),
        $windowHeight = $('.windowHeight'),
        $InnerWidth = $('.InnerWidth'),
        $InnerHeight = $('.InnerHeight'),
        $RealWidth = $('.RealWidth'),
        $RealHeight = $('.RealHeight'),
        ie8lte = false,
        browserScaleUp = false,
        _orgWidth = $(window).width();
    (function CheckIe() {
        if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
            var ieVer = new Number(RegExp.$1);
            if (ieVer <= 8) {
                ie8lte = true;
            }
            //if
        }
        //if
    })();

    function BrowserSize() {
            var _window = window,
                _inner = 'inner';
            if (!('innerWidth' in window)) {
                _inner = 'client';
                _window = document.documentElement || document.body;
            }

            if (!ie8lte) {
                // ie8 이하이지 않을 때
                return {
                    width: _window[_inner + 'Width'],
                    height: _window[_inner + 'Height']
                }
            } else {
                //  ie8 이하일 때
                if (!browserScaleUp) {
                    // 브라우저를 줄일 경우
                    return {
                        width: _window[_inner + 'Width'] + 0,
                        height: _window[_inner + 'Height'] + 0
                    }
                } else {
                    // 브라우저를 키울 경우
                    return {
                        width: _window[_inner + 'Width'] - 6,
                        height: _window[_inner + 'Height'] - 6
                    }
                }
            }
        }
        // fn. BrowserSize
        /* 브라우져 사이즈 레퍼런스 끝*/
    function getCookie(name) {
            var nameOfCookie = name + "=";
            var x = 0;
            while (x <= document.cookie.length) {
                var y = (x + nameOfCookie.length);
                if (document.cookie.substring(x, y) == nameOfCookie) {
                    if ((endOfCookie = document.cookie.indexOf(";", y)) == -1)
                        endOfCookie = document.cookie.length;
                    return unescape(document.cookie.substring(y, endOfCookie));
                }
                // if
                x = document.cookie.indexOf(" ", x) + 1;
                if (x == 0) break;
            }
            // while
            return "";
        }
        // function getCookie

    function popupWindow() {
            if (getCookie("recruitPopup") != "done" && popupOpen == false) {
                window.open("/popup20141023.html", "recruitPopup", "width = 600, height=1000, left=0, top=0, scrollbars=auto,titlebar=no,status=no,resizable=no,fullscreen=no");
                popupOpen = true;
            }
            // if
        }
        // function popupWindow
    function MakeSlideNav() {

            for (var i = 0; i < totalSlides; i++) {
                // $slideNavElement.clone().appendTo($slideNavul);
                $slideNavul.append('<li><a href="#" title="슬라이드 이동"></a></li>')
                    //등록된 이미지만큼 목록을 만들어준다.
            }
            //for
            var $NslideNavElement = $('#slideNavul').find('li'),
                $slideNav = $('.slideNav');

            $('#slideNavul').append('<li class="slideCntrLi"><span class="slideCntr slide_played"><img src="/resources/image/mainSlide/cntr_pause.png" border="0" alt="슬라이드 멈춤 버튼 이미지"></span></li>');
            var $slideCntr = $('.slideCntr');

            $NslideNavElement.find('a').click(function(e) {
                var $thisParent = $(this).parent(),
                    myorder = $NslideNavElement.index($thisParent),
                    urlLink = $slideElement.eq(totalSlides - myorder - 1).attr('data-url'),
                    event = e;
                // $slideLink.prop('href', urlLink);
                indexSlide(myorder);
                SlideNav();
                ActiveProduceTeam();
                slidepaused($slideCntr);
                eventClick(event);

                // console.log(myorder);
            });
            //슬라이딩 목록 버튼 클릭 정의

            $slideCntr.click(function(event) {
                _this = $(this);
                if (_this.hasClass('slide_played')) {
                    _this.removeClass('slide_played')
                        .addClass('slide_paused')
                        .find('img').attr('src', '/resources/image/mainSlide/cntr_play.png')
                        .attr('alt', '슬라이드 재생 버튼 이미지');
                    window.clearInterval(SlideInterval);

                } else {
                    slidepaused(_this);
                }
                //if
                eventClick(event);
            });

            function slidepaused(target) {
                    var _this = target;
                    _this.removeClass('slide_paused')
                        .addClass('slide_played')
                        .find('img').attr('src', '/resources/image/mainSlide/cntr_pause.png')
                        .attr('alt', '슬라이드 멈춤 버튼 이미지');
                    indexSlide(totalSlides - currentSld);
                }
                //슬라이드 멈춤 정의
        }
        //fn MakeSlideNav

    var bgsizeW = BrowserSize().width;
    var btnVercalHeight;

    function indexSlideAreaFn() {


            var $windowHeight = $(window).innerHeight(),
                // bgsizeW = $(window).innerWidth(),
                $bgSlideLayerImg = $('#bgSlideLayer > ul > li  img'),
                $wrap_indexHeader = $('#wrap_index header'),
                // 이미지 의 끝지점은  창 넓이의 90% x 세로비율 1.5 에다가 메뉴바 50 + 메뉴바에서 이미지까지 거리 200 + bottom 패이딩
                navVerticalPosition,
                imgPath = "/image/",
                flexibleMgtop,
                slideImgWidth,
                slideImgWidthVal,
                slideImgHeight,
                slideImgLeft,
                ImgHeightSize,
                ImgWidthSize,
                ImgWidthSizeOver = 94,
                ratioImg = 1.514957264957265,
                slideNavBottom,
                btnMgt;

            if (getCrntMediaQueryWidth <= 1) {
                bottompadding = 110;
                ImgWidthResize = 0;
                // flexibleMgtop = 70;
                responMgt = 50;
                btnMgt = 0;

            } else {
                bottompadding = 30;
                ImgWidthResize = 0;
                // flexibleMgtop = 180;            
                responMgt = 153;
                btnMgt = 153;
            }
            // $ImgVerticalEndposition = Math.round(((bgsizeW*0.9)*1.5 )+ (50+200+bottompadding));
            /*$index_articleWrap. css({
                'height' : $windowHeight - 161
            });    */

            ImgHeightSize = $windowHeight - (140) + responMgt,
                ImgWidthSize = Math.round(ImgHeightSize / ratioImg);
            // console.log('ImgWidthSize' + ImgWidthSize)
            if (ImgWidthSize < ImgWidthSizeOver) {
                bgSlideLayerWrapH = 280;
                ImgCenter = 100;
                Imgwidth = 100;
                goto_part_lineheight = 250;
            } else {
                bgSlideLayerWrapH = ImgHeightSize + 280 - 12 - 128;
                if (ImgWidthSize < 100) {
                    ImgWidthSize = 100;
                }
                ImgCenter = ImgWidthSize + 50 - responMgt;
                Imgwidth = ImgWidthSize + 50 - responMgt;
                goto_part_lineheight = $windowHeight - ImgWidthSize;
            };
            //if
            if (getCrntMediaQueryWidth == 0) {
                $wrap_indexHeader.hide();
                slideNavBottom = 15;
                btnVercalHeight = 43;

            } else if (getCrntMediaQueryWidth == 1) {
                $wrap_indexHeader.hide();
                slideNavBottom = 15;
                btnVercalHeight = 43;

            } else {
                // flexibleMgtop = ($(window).innerHeight() - 50) - (ImgHeightSize + 40);               
                // flexibleMgtop = ($(window).innerHeight()-50) - ((Imgwidth - ImgWidthResize)*ratioImg) - 40;
                $wrap_indexHeader.show();
                slideNavBottom = 30;
                btnVercalHeight = 105;
            }
            // 캔버스 - 오브젝트 / 2

            // console.log(ImgHeightSize)
            var percent = 0.90;
            if (ImgWidthSize < ImgWidthSizeOver) {
                // slideNavTop = Math.round(((Imgwidth - ImgWidthResize)*ratioImg)  + flexibleMgtop + 5); 

                slideImgHeight = Math.round(((Imgwidth - ImgWidthResize) * ratioImg));
                slideImgWidth = Imgwidth;
                slideImgWidthVal = slideImgWidth + 'px';
                slideImgLeft = ($(window).innerWidth() * 0.5) - (slideImgWidth * 0.5);
                // flexibleMgtop = 50+responMgt + (($windowHeight-50 - 30) - slideImgHeight) *0.5;
                flexibleMgtop = (($windowHeight - responMgt - (slideNavBottom + 22)) - (slideImgHeight)) * 0.5 + responMgt;
                goto_part_top = flexibleMgtop + 15;
                console.log("C " + $(window).innerWidth())
            } else {

                if (Imgwidth - ImgWidthResize > $(window).innerWidth()) {
                    // slideNavTop = ($(window).innerWidth() * percent * ratioImg )  + 90 +  responMgt - 22 + 10;
                    slideImgHeight = ($(window).innerWidth() * percent * ratioImg);
                    slideImgWidth = percent * 100;
                    slideImgWidthVal = slideImgWidth + "%"
                    slideImgLeft = ($(window).innerWidth() * (1 - percent)) * 0.5;
                    // flexibleMgtop = responMgt + ($windowHeight - slideImgHeight) *0.5;
                    flexibleMgtop = (($windowHeight - responMgt - (slideNavBottom + 22)) - (slideImgHeight)) * 0.5 + responMgt;
                    // goto_part_top = ($windowHeight - slideImgHeight - responMgt)*0.5 + 150;
                    goto_part_top = (flexibleMgtop + (slideImgHeight) * 0.5 - btnVercalHeight) - btnMgt;
                    // console.log("A " )
                } else {
                    // slideNavTop = Math.round(((Imgwidth - ImgWidthResize)*ratioImg)  + flexibleMgtop + 5);    
                    slideImgWidth = Math.round(Imgwidth - ImgWidthResize) - (responMgt / ratioImg);
                    if (slideImgWidth < 120) {
                        slideImgWidth = 120;
                    }
                    slideImgHeight = Math.round(slideImgWidth * ratioImg);
                    slideImgWidthVal = slideImgWidth + "px"
                    slideImgLeft = ($(window).innerWidth() * 0.5) - (slideImgWidth * 0.5);
                    //반응형 간격을 전체 창에서 빼고 + 90을 더 밴 상태에서 가운데 정렬을 해야하는데 , 이 크기에서 이미지 크기를 빼고 반을 나누어 빼면 된다.
                    flexibleMgtop = (($windowHeight - responMgt - (slideNavBottom + 22)) - (slideImgWidth * ratioImg)) * 0.5 + responMgt;
                    // flexibleMgtop =  responMgt + ($windowHeight- responMgt + 90 )*0.5;
                    // goto_part_top = (slideImgHeight - responMgt)*0.5 ;
                    //전체 캔버스 높이 - 이미지 마진값  + 이미지의 반값 - 버튼의 높이 반값
                    // goto_part_top = ((flexibleMgtop - responMgt) + (slideImgWidth*ratioImg) )* 0.5 - btnVercalHeight;
                    goto_part_top = (flexibleMgtop + (slideImgWidth * ratioImg) * 0.5 - btnVercalHeight) - btnMgt;
                    // slideLinkHeight = bgSlideLayerWrapH-257 + 'px';
                    // console.log("B " + slideImgWidth*ratioImg)
                }
                //if       

            }
            $('nav.slideNav').stop().animate({
                'bottom': Math.round(slideNavBottom) + 'px'
                    // 슬라이드 네비를 이미지 아래 고정
            }, 600, 'easeOutQuint');
            $VcommArea.stop().animate({
                'top': Math.round(goto_part_top) + 'px'
                    // 'line-height': Math.round(goto_part_lineheight) + 'px'
            }, 550, 'easeOutQuint');
            $VlabArea.stop().animate({
                'top': Math.round(goto_part_top) + 'px'
                    // 'line-height': Math.round(goto_part_lineheight) + 'px'
            }, 550, 'easeOutQuint');

            //슬라이드 Wrap 변경
            $bgSlideLayerWrap.css({
                'height': bgSlideLayerWrapH - responMgt
            });

            if (ImgWidthSize < ImgWidthSizeOver) {
                body.css({
                    'overflow': 'auto'
                });
            } else {
                body.css({
                    'overflow': 'hidden'
                });
            }
            $('#wrap_index').height(bgSlideLayerWrapH - responMgt)

            //이미지 크기 변경
            $bgSlideLayerImg.each(function(index) {
                var _this = $(this),
                    getImgWidth = _this.width(),
                    getImgHeight = _this.height()
                ratio = getImgHeight / getImgWidth;
                _this.stop().css({
                    'left': slideImgLeft,
                    'width': slideImgWidthVal,
                    'margin-top': flexibleMgtop + 'px'
                });
            });
            // $slideLink.css({
            //     'height' : slideLinkHeight
            // });    
            // $slideClickArea.css({
            //     'top' : Math.round(slideLinkTop) + 'px'
            // });
        }
        //메인 슬라이드 영역 정의

    function goto_part() {
        var $VcommAreaButton = $VcommArea,
            $VlabAreaButton = $VlabArea;
        if (getCrntMediaQueryWidth <= 1) {

            $VcommAreaButton.on('mouseenter', function() {
                var _this = $(this);
                _this.find('img').attr('src', '/resources/image/main_goVcomm_mobile.png');
            }).on('mouseleave', function() {
                var _this = $(this);
                _this.find('img').attr('src', '/resources/image/main_goVcomm_mobile.png');
            });
            //button
            $VlabAreaButton.on('mouseenter', function() {
                var _this = $(this);
                _this.find('img').attr('src', '/resources/image/main_goVlab_mobile.png');
            }).on('mouseleave', function() {
                var _this = $(this);
                _this.find('img').attr('src', '/resources/image/main_goVlab_mobile.png');
            });
            //button        
        } else {
            $VcommAreaButton.on('mouseenter', function() {
                //Vcomm 버튼에 마우스 오버시
                $VcommArea.find('img').attr('src', '/resources/image/main_goVcomm_hover.png');
                $VcommArea.addClass('hover');
            }).on('mouseleave', function() {
                $VcommArea.find('img').attr('src', '/resources/image/main_goVcomm.png');
                $VcommArea.removeClass('hover');
            });
            //button
            $VlabAreaButton.on('mouseenter', function() {
                //Vlab 버튼에 마우스 오버시
                $VlabArea.find('img').attr('src', '/resources/image/main_goVlab_hover.png');
                $VlabArea.addClass('hover');
            }).on('mouseleave', function() {
                $VlabArea.find('img').attr('src', '/resources/image/main_goVlab.png');
                $VlabArea.removeClass('hover');
            });
            //button                
        }
        //if
    };
    //fn. goto_part

    function indexSlide(val) {
        var wh = $(window).height();
        if (!val > 0) {
            val = 0;
        }
        currentSld = totalSlides - val;
        // console.log("eq 던진값 : " +val + ' / 대상 li 레벨:'+currentSld);
        for (i = 0; i < totalSlides; i++) {
            if (i < currentSld) {
                $slideElement.eq(i).stop().animate({
                    'height': '100%'
                }, speed, 'easeInOutQuint');
            } else {
                $slideElement.eq(i).stop().animate({
                    'height': '0px'
                }, speed, 'easeInOutQuint');
            }
            // console.log("확인 : " + $slideElement.eq(i).height())
        }
        //for				
        window.clearInterval(SlideInterval);
        SlideInterval = window.setInterval(function() {
            sliding();
        }, intervalTime);

    };


    function sliding() {
            var wh = $(window).height(),
                urlLink = $slideElement.eq(currentSld - 2).attr('data-url');
            // $slideLink.prop('href', urlLink);
            if (currentSld == 1) {
                //맨끝 슬라이드
                // console.log('초기화 : '+ currentSld)
                $slideElement.eq(currentSld - 1).stop().animate({
                    'height': '0px'
                }, speed, 'easeInOutQuint', function() {

                    $slideElement.css({
                        'height': '100%'
                            // 'height' : wh
                    });
                });
                currentSld = totalSlides;
            } else if (currentSld > 0) {
                //진행중 슬라이드
                // console.log('- : ' + currentSld)
                $slideElement.eq(currentSld - 1).stop().animate({
                    'height': '0px'
                }, speed, 'easeInOutQuint');
                currentSld--;
            }
            //if

            SlideNav();
            ActiveProduceTeam();
        }
        //슬라이딩 인터벌 정의



    function SlideNav() {
        var _crntN = totalSlides - currentSld;
        $slideNavul.find('li').removeClass('active');

        $slideNavul.find('li').eq(_crntN).addClass('active'),
            datapart = $slideElement.eq(currentSld - 1).attr('data-part'),
            VlabAreaHover = $(".VlabArea:hover").length > 0,
            VcommAreaHover = $('.VcommArea:hover').length > 0;

    }

    function ActiveProduceTeam() {
        if (getCrntMediaQueryWidth <= 1) {

            // 모바일 화면에서는 ui가 변경되어 제작 파트의 모션이 다르게 연출됨
            $VcommArea.find('img').attr('src', '/resources/image/main_goVcomm_mobile.png');
            $VlabArea.find('img').attr('src', '/resources/image/main_goVlab_mobile.png');
            if (datapart == "vcomm") {
                $VcommArea.find('img').stop().animate({
                    'left': ($(window).width() * 0.5) * 0.5 - btnVercalHeight
                }, 600, 'easeInOutQuint');
                $VlabArea.find('img').stop().animate({
                    'right': '-300px'
                }, 600, 'easeInOutQuint');
            } else if (datapart == "vlab") {
                $VcommArea.find('img').stop().animate({
                    'left': '-300px'
                }, 600, 'easeInOutQuint');
                $VlabArea.find('img').stop().animate({
                    'right': ($(window).width() * 0.5) * 0.5 - btnVercalHeight
                }, 600, 'easeInOutQuint');
            }
            // console.log('datapart'+ datapart + " / " + $(window).width())        
        } else {
            $VcommArea.find('img').stop().css({
                'left': '0'
            });
            $VlabArea.find('img').stop().css({
                'right': '0'
            });

            if ($VcommArea.hasClass('hover') || $VlabArea.hasClass('hover')) {
                //마우스가 오버 상태 경우
                if ($VcommArea.hasClass('hover') && datapart == "vcomm") {
                    $VlabArea.find('img').attr('src', '/resources/image/main_goVlab.png');
                } else if ($VcommArea.hasClass('hover') && datapart == "vlab") {
                    $VlabArea.find('img').attr('src', '/resources/image/main_goVlab_select.png');
                } else if ($VlabArea.hasClass('hover') && datapart == "vcomm") {
                    $VcommArea.find('img').attr('src', '/resources/image/main_goVcomm_select.png');
                } else if ($VlabArea.hasClass('hover') && datapart == "vlab") {
                    $VcommArea.find('img').attr('src', '/resources/image/main_goVcomm.png');
                }
                //End if
            } else {
                //기본 상태에서는 각 해당하는 것에 보여줌
                if (datapart == "vcomm") {
                    $VcommArea.find('img').attr('src', '/resources/image/main_goVcomm_select.png');
                    $VlabArea.find('img').attr('src', '/resources/image/main_goVlab.png');
                } else if (datapart == "vlab") {
                    $VcommArea.find('img').attr('src', '/resources/image/main_goVcomm.png');
                    $VlabArea.find('img').attr('src', '/resources/image/main_goVlab_select.png');
                }
                //End if
            }
            //if. getCrntMediaQueryWidth
        }
        //제작 그룹 활성화
    }

    //슬라이드 네비 활성화

    /*function ShowHideMusic(){
        var $birdmotion = $('#birdmotion');
        if (getCrntMediaQueryWidth == 0 || getCrntMediaQueryWidth == 1){
            console.log("작아요~");
        }
    }*/
    /*-------------------프로덕트-------------------*/
    var $sortType1 = $('#sortType1'),
        $sortType2 = $('#sortType2'),
        $sortBtn = $('.action_sort'),
        $tab0 = $('.tab0'),
        $tab1 = $('.tab1'),
        $tab2 = $('.tab2'),
        $tab3 = $('.tab3'),
        $tab4 = $('.tab4'),
        $tab5 = $('.tab5'),
        $tab6 = $('.tab6'),
        $vimeo_pop = $(".vimeo_pop"),
        $product_vimeoPlayer = $('#product_vimeoPlayer'),
        $tabContent = $('.tabContent'),
        $section_list = $('.section_list'),
        $related_sec = $('.related_sec'),
        $lineup_con = $('.lineup_con'),
        $product_nav = $('#product_nav'),
        $action_prev = $('.action_prev'),
        $action_next = $('.action_next'),
        $pro_list1 = $('#pro_list1'),
        $pro_list2 = $('#pro_list2'),
        $pro_list3 = $('#pro_list3'),
        $pro_list4 = $('#pro_list4'),
        $pro_list5 = $('#pro_list5'),
        $pro_list6 = $('#pro_list6');
    	_currentTabNavNum = 0,
    	_currentMoveClick = 0,
    	_currentTabNum = 0;


    /*function product_load_next() {
        $tabContent.hide();
        // for(var i = 2; i <= 6; i ++){
        // 	$('#pro_list'+i).hide();
        // };

    }*/
    // $sortType2.hide();

    $sortBtn.click(function(event) {
        // 정렬 버튼을 누르면
        var _this = $(this);
        if ($sortBtn.hasClass('type1')) {
            // 보기 방식 : 라인업만 보기 선택 = type2
            $sortType2.show();
            // 라인업 엘리먼트가 보이고
            $sortBtn.removeClass('type1').addClass('type2');
            // 버튼에 type2로 클래스 변경
            $pro_list1.hide();
            // 라인업이 나오는 엘리먼트 가리고
            $related_sec.hide();
            // 관련 제품 엘리먼트 가리고
            // $tabContent.hide();
            // 각 탭 컨텐츠들 가리고
            $lineup_con.show();
            // 라인업 컨텐츠들 가리고
            _this.find('img').attr('src', '/resources/image/product/listBtn_close.png');
            // 버튼 이미지도 X로 바꾼다.
            $('.tabContents').hide();
        } else {
            //  보기 방식 : 탭 컨텐츠로 보기 = type1
            $sortBtn.removeClass('type2').addClass('type1');
            if (_currentTabNavNum == 0) {
                // 어바웃 프로덕트는 라인업, 관련 제품 없으므로 가린다.
                $pro_list1.hide();
                $related_sec.hide();
            } else {
                $pro_list1.show();
                $related_sec.show();
            }
            // if
            /*$pro_list1.show();
            $related_sec.show();*/
            // $tabContent.show();
            $lineup_con.hide();
            _this.find('img').attr('src', '/resources/image/product/listBtn_sort.png');
            $('.tabContents').show();
        }
        //if
        $(".lineup_list > ul").empty();
        eventClick(event);
    });
    //보기방식 버튼 click

    $section_list.find('a').click(function() {
            // 각 탭의 아이콘을 클릭하면

            var _this = $(this),
                _thisParent = _this.parent();
            // $sortBtn.click;
            $section_list.find('li').removeClass('activeTab');
            // 기존의 엑티브 클래스를 찾아 지운다.
            $tabContent.removeClass('activeTab');
            // 탭 컨텐츠에서도 액티브 클래스를 찾아 지운다.
            $tabContent.eq(_thisParent.index()).addClass('activeTab');
            // 선택된 탭 네비 번호에 해당되는 탭 컨텐츠에 액티브 클래스를 추가한다.
            _currentTabNavNum = _thisParent.index();
            // 현재 탭 선택 순번을 변수로 정의한다.
            _thisParent.addClass('activeTab');
            // 버튼 부모의 li 에 액티브 클래스를 추가한다.
            tabContentShowHide();
            // 탭 컨텐츠 보이고 숨기는 함수 실행
            ProductImageChange();
            // 프로젝트 이미지 교체 함수 실행

            if ($sortBtn.hasClass('type2')) {
                // 만약 현재 보기 모드가 type2인 라인업만 보기 모드라면 ( 즉, 정렬 방식 변경하기 버튼 클릭 상태임 - 다시 보기 방식을 바꿔야함)
                $sortBtn.removeClass('type2').addClass('type1');
                $(".lineup_list > ul").empty();
                // 보기 방식이 바뀌었다고 해당 버튼에 클래스 교체
                // $pro_list1.show();
                // 라인업 이미지가 나오게 하기
                // $related_sec.show();
                // $tabContent.show();
                $('.tabContents').show();
                $lineup_con.hide();
                $sortBtn.find('img').attr('src', '/resources/image/product/listBtn_sort.png');
            }
            //if
            _currentTabNum = _currentTabNavNum;
            eventClick(event);

        })
        //각 탭 아코디언 click
    function tabContentShowHide() {
            var $tabContents = $('.tabContents');
            $tabContents.find('> div').hide();
            // 탭 컨텐츠 박스에서 .tabContent를 일단 다 가리고
            $tabContents.find('> div.activeTab').show();
            // 액티브 클래스를 가진 자식만 보여진다.

            if (_currentTabNavNum == 0) {
                // 어바웃 프로덕트는 라인업, 관련 제품 없으므로 가린다.
                $pro_list1.hide();
                $related_sec.hide();
            } else {
                $pro_list1.show();
                $related_sec.show();
            }
            // if
        }
        //fn. tabContentShowHide

    var productTabTotalNum = $section_list.find('li').length;

    function tabNav(num) {
            var num = num,
                $mq_windowWidth = getCrntMediaQueryWidth;

            if ($mq_windowWidth == 0) {
                _maxMove = productTabTotalNum - ($mq_windowWidth + 1);
            } else {
                _maxMove = productTabTotalNum - $mq_windowWidth;
            }

            if (-num == _maxMove) {
                $action_next.css('cursor', 'default').find('img').css('opacity', '0.1');
            } else {
                $action_next.css('cursor', 'pointer').find('img').css('opacity', '1');
            }

            if (num == 0) {
                $action_prev.css('cursor', 'default').find('img').css('opacity', '0.1');
            } else {
                $action_prev.css('cursor', 'pointer').find('img').css('opacity', '1');
            }
        }
        //이전, 다음 버튼 활성,비활성화

    $action_next.click(function(event) {
            var $mq_windowWidth = getCrntMediaQueryWidth;
            if ($mq_windowWidth == 0) {
                _maxMove = productTabTotalNum - ($mq_windowWidth + 1);
            } else {
                _maxMove = productTabTotalNum - $mq_windowWidth;
            }

            if (-(_currentMoveClick) < _maxMove) {
                _currentMoveClick--;
                moveSectionList(_currentMoveClick);
            }
            eventClick(event);
        })
        //$action_next 클릭

    $action_prev.click(function(event) {
            if (_currentMoveClick < 0) {
                _currentMoveClick++;
                moveSectionList(_currentMoveClick);
            }
            eventClick(event);
        })
        //$action_prev 클릭
        // var  widthHalf = $product_nav.width()* 0.5;
    function tabUiResize() {
        var $section_listLia = $section_list.find('li');

        // console.log('찍음 ' +  $(window).width()*0.5)
        if (getCrntMediaQueryWidth < 1) {
            $section_listLia.width($(window).width() * 0.5);
        } else {
            $section_listLia.width('235px');
        }
        //if
    }

    function moveSectionList(num) {
            var _buttonWidth;
            /*,
                widthHalf = $product_nav.width()* 0.5;*/
            if (getCrntMediaQueryWidth < 1) {
                _buttonWidth = $(window).width() * 0.5 + 1;
            } else {
                _buttonWidth = 236;
            }
            var moveX = (num * _buttonWidth);
            // console.log(num + num + ' / moveX ' + moveX)
            $section_list.stop().animate({
                'left': moveX + 'px'
            }, 400, 'easeInOutQuint');
            tabNav(_currentMoveClick);
        }
        //fn.moveSectionList 

    function reload_title() {
            var $mq_windowWidth = getCrntMediaQueryWidth,
                $tab_titleImg = $('.tab_title > img');
            if ($mq_windowWidth == 0 || $mq_windowWidth == 1) {
                sizeNumber = 'size0';
            } else if ($mq_windowWidth == 2 || $mq_windowWidth == 3) {
                sizeNumber = 'size3';
            } else if ($mq_windowWidth == 4 || $mq_windowWidth == 5) {
                sizeNumber = 'size5';
            }
            $tab_titleImg.each(function(index) {
                var _this = $(this),
                    getImg = _this.attr('src'),
                    beforeText = getImg.substring(getImg.indexOf("size"), getImg.indexOf("_title.png")),
                    afterText = getImg.replace(beforeText, sizeNumber);
                _this.attr('src', afterText);
            });
            // }
        }
        // moveSectionList(0);    
    var productVideoUIrl = [
        "",
        "85228457",
        "37151555",
        "85228455",
        "98106708",
        "105087758",
        ""
    ];

    $tabContent.each(function(index) {
            var _this = $(this),
                data = '<iframe src="//player.vimeo.com/video/' + productVideoUIrl[index] + '" class="vimeoIframe" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe><a class="con_close" href="#none"><img src="/image/icon/pop_close.gif" alt="닫기"></a>';

            _this.find('.viewmovie a').click(function(event) {
                eventClick(event);
                settNum = $(window).scrollTop();
                dimclick = 0;
                $vimeo_pop.html(data);
                $vimeo_pop.show();
                $vimeo_pop.css("height", parseInt($vimeo_pop.css("width")) / 1.77);
                motionPopup('open_vimeo', "vimeo", settNum);
                // body.css("overflow","hidden");            
                $vimeo_pop.find('.con_close').click(function() {
                    closeAction("close_product");
                });
                //click
            });
            //click

        })
        //each

    function ProductImageChange() {
            var $tabContents = $('.product_article > .tabContents'),
                $tabContentImg = $tabContents.find('.activeTab > section > img'),
                tabNumber = $tabContents.find('div.activeTab ').index(),
                totalSection = $tabContents.find('div.activeTab section').length,
                imgSrc = ['/resources/image/product/proN_' + tabNumber,
                    '/resources/image/product/proN_' + tabNumber,
                    '/resources/image/product/proN_' + tabNumber,
                    '/resources/image/product/proN_' + tabNumber
                ];
            // console.log ("tabNumber " + tabNumber)
            if (getCrntMediaQueryWidth == 0 || getCrntMediaQueryWidth == 1) {
                for (var i = 0; i < totalSection; i++) {
                    $tabContentImg.eq(i).attr('src', imgSrc[i] + '_size0_' + (i + 1) + '.jpg');
                }
            } else if (getCrntMediaQueryWidth == 2 || getCrntMediaQueryWidth == 3) {
                for (var i = 0; i < totalSection; i++) {
                    $tabContentImg.eq(i).attr('src', imgSrc[i] + '_size3_' + (i + 1) + '.jpg');
                    // console.log($tabContentImg.eq(i).attr('src'))
                }
            } else if (getCrntMediaQueryWidth >= 4) {
                for (var i = 0; i < totalSection; i++) {
                    $tabContentImg.eq(i).attr('src', imgSrc[i] + '_size5_' + (i + 1) + '.jpg');
                }
            }
            //if
        }
        //End ProductImageChange
        /*-------------------About-------------------*/
    function contentsImageChange() {
            var $about_secInner = $('.about_secInner'),
                $about_secInnerImg = $about_secInner.find('section > img'),
                imgSrc = ['/resources/image/about_top',
                    '/resources/image/about_con1',
                    '/resources/image/about_con2',
                    '/resources/image/about_con3',
                    '/resources/image/about_con4'
                ];

            if (getCrntMediaQueryWidth == 0) {
                for (var i = 0; i < 5; i++) {
                    $about_secInnerImg.eq(i).attr('src', imgSrc[i] + '_1.jpg');
                }
            } else if (getCrntMediaQueryWidth == 1 || getCrntMediaQueryWidth == 2 || getCrntMediaQueryWidth == 3) {
                for (var i = 0; i < 5; i++) {
                    $about_secInnerImg.eq(i).attr('src', imgSrc[i] + '_4.jpg');
                }
            } else if (getCrntMediaQueryWidth >= 4) {
                for (var i = 0; i < 5; i++) {
                    $about_secInnerImg.eq(i).attr('src', imgSrc[i] + '_5.jpg');
                }
            }
            //if
        }
        //End fn.contentsImageChange
        /*-------------------Culture-------------------*/
    function loadCulture() {
            var $culture_article = $('.culture_article'),
                $culture_articleBg = $culture_article.find('img'),
                imgSrc = ['/resources/image/culture/culture_title_mobile',
                    '/resources/image/culture/culture_title_1024',
                    '/resources/image/culture/culture_title_1420'
                ];

            if (getCrntMediaQueryWidth == 0) {
                $culture_articleBg.attr('src', imgSrc[0] + '.jpg');
            } else if (getCrntMediaQueryWidth == 1 || getCrntMediaQueryWidth == 2 || getCrntMediaQueryWidth == 3) {
                $culture_articleBg.attr('src', imgSrc[1] + '.jpg');
            } else if (getCrntMediaQueryWidth >= 4) {
                $culture_articleBg.attr('src', imgSrc[2] + '.jpg');
            }
            //if   
        }
        /*-------------------Newsletter-------------------*/
    function loadNewsletter() {
        var $buttonRegist = $('.buttonRegist'),
            $buttonClose = $('.buttonClose'),
            $registPopup = $('.registPopup'),
            $buttonRegistCfm = $('.buttonRegistCfm');

        $buttonRegist.find('img').on('mouseenter', function() {
            var _this = $(this);
            _this.attr('src', '/resources/image/newsletterRegist_hover.png');
        }).on('mouseleave', function() {
            var _this = $(this);
            _this.attr('src', '/resources/image/newsletterRegist.png');
        }).on('click', function(event) {
            $registPopup.show().stop().animate({
                'opacity': '1',
                'top': '0'
            }, 600, 'easeInOutQuint');
            eventClick(event);
        });
        //  end $buttonRegist

        $buttonRegistCfm.find('img').on('mouseenter', function() {
            var _this = $(this);
            _this.attr('src', '/resources/image/newsletterCfm_hover.png');
        }).on('mouseleave', function() {
            var _this = $(this);
            _this.attr('src', '/resources/image/newsletterCfm.png');
        });


        $buttonClose.find('a').on('click', function(event) {
            var $username = $('#username'),
                $useremail = $('#useremail'),
                $usercompany = $('#usercompany'),
                $userposition = $('#userposition');

            $registPopup.stop().animate({
                'opacity': '0',
                'top': '-60px'
            }, 600, 'easeInOutQuint', function() {
                $registPopup.hide();
                $username.val("");
                $useremail.val("");
                $usercompany.val("");
                $userposition.val("");
            });
            eventClick(event);
        });
        // end $buttonClose        

        // $buttonRegistCfm.on('click', function(){
        //     checkForm();
        // })
        //end $buttonRegistCfm

    }




    /*--------------------------------------*/
    function changeBtn(val) {
            var $recruitTab = $('.recruitTab');
            if (val == "a") {
                changeChrt = "b";
            } else {
                changeChrt = "a";
            }
            $recruitTab.find("li img").each(function(index) {
                var _this = $(this),
                    getImg = _this.attr('src'),
                    newImg = getImg.replace("btn_recruitTab_" + val, "btn_recruitTab_" + changeChrt);
                _this.attr('src', newImg);
            });
        }
        /*-----------------------------------------------*/
    FngetCrntMediaQueryWidth();
    /*function AutoRollUp(){
         if(getCrntMediaQueryWidth <= 1){
                body.stop().animate({scrollTop:'102px'},800,'easeInOutQuint');
                // console.log("읭?")
            }
            //if
    }*/
    if (window.this_file == 'index') {
        //index의 경우 실행
        $slideElement.each(function(index) {
            var _this = $(this),
                color = _this.attr('data-color');
            _this.css({
                'background-color': color
            });
        });
        // AutoRollUp();
        $slideElementLast.clone().prependTo($bgSlideLayer.find('ul'));
        // $slideLink.attr('href', $slideElement.eq(totalSlides-1).attr('data-url'));
        $slideLink.prop('href', $slideElement.eq(totalSlides - 1).attr('data-url'));
        MakeSlideNav();
        indexSlide(0);
        indexSlideAreaFn();
        SlideNav();
        goto_part();
        ActiveProduceTeam();
        $VcommArea.css({
            'top': Math.round(goto_part_top) + "px"
                // 'line-height': Math.round(goto_part_lineheight) + "px"
        });
        $VlabArea.css({
            'top': Math.round(goto_part_top) + "px"
                // 'line-height': Math.round(goto_part_lineheight) + "px"
        });

        /*var mobileKeyWords = new Array('iPhone', 'iPad', 'BlackBerry', 'Android', 'Windows CE', 'LG', 'MOT', 'SAMSUNG', 'SonyEricsson', 'Opera Mini', 'Microsoft Windows', 'Opera Modi');
           for (var word in mobileKeyWords){ 
               if (navigator.userAgent.match(mobileKeyWords[word]) != null){
                   // break;
               }else{
                   popupWindow();
               }
        }*/
        
        
        // 팝업 관련 정지 20141104
        /*
        if (getCrntMediaQueryWidth > 1) {
            popupWindow();
        }
        */


    } else if (window.this_file == 'product') {
        //product의 경우 실행        
        tabUiResize();
        tabNav(0);
        var $lineup_con = $('.lineup_con');
        $lineup_con.hide();
        $tabContent.hide();
        tabContentShowHide();
        // reload_title();
        ProductImageChange();
    } else if (window.this_file == 'recruit') {
        //recruit의 경우 실행
        // load_recruit();
    } else if (window.this_file == 'about') {
        contentsImageChange();
    } else if (window.this_file == 'newsletter') {
        loadNewsletter();
    } else if (window.this_file == 'work') {

    } else if (window.this_file == 'culture') {
        loadCulture();
    }
    ResizeGnb();


    /*-------------------전체 공통-------------------*/
    $(window).resize(function() {
        bgsizeW = BrowserSize().width;
        var wh = $(window).height();
        ResizeGnb();
        musicActiveCase();
        FngetCrntMediaQueryWidth();

        if (window.this_file == 'product') {
            _currentMoveClick = 0;
            calc = productTabTotalNum;
            tabNav(0);
            moveSectionList(0);
            // console.log('_currentMoveClick' + _currentMoveClick)
            // reload_title();
            ProductImageChange();
            // widthHalf = $product_nav.width()* 0.5;
            tabUiResize();
            $vimeo_pop.css("height", parseInt($vimeo_pop.css("width")) / 1.77);
            // console.log(BrowserSize().width)
            //프로덕트 초기화
        } else if (window.this_file == 'about') {
            contentsImageChange();
        } else if (window.this_file == 'culture') {
            loadCulture();
        }
        // product_resizeLoad();		 			 	
        if (PlayPageFile >= 0) {
            indexSlideAreaFn();
            // AutoRollUp();
            goto_part();
            ActiveProduceTeam();
        }
    });
    //리사이즈에 대한 
});

$(document).on("click", '.gotoTop img', function(event) {
    //click
    eventClick(event);
    $('body').stop().animate({
        scrollTop: 0
    }, 400, 'easeInOutQuint');
}).on('mouseenter', '.gotoTop img', function() {
    var _this = $(this);
    _this.attr('src', '/resources/image/icon/gotoTop.gif');
    console.log("over")
}).on('mouseleave', '.gotoTop img', function() {
    var _this = $(this);
    _this.attr('src', '/resources/image/icon/gotoTop.png');
});

function eventClick(event) {
    if (event.preventDefault) {
        event.preventDefault(); //FF
    } else {
        event.returnValue = false; //IE
    }
}
//return false 대신용 #링크 사용시 꼭 넣을 것


